Read Me - SimpleCocoaMovie

This sample contains code showing how to use the NSMovieView and NSMovie Cocoa AppKit classes. The code attemps to duplicate the functionality of the standard QuickTime movie controller using the NSMovieView/NSMovie methods. In the model/controller/view paradigm, the sample defines a controller object, the MyMovieController class, to act as a mediator between the view objects and the model objects. The view objects consist of a main window which contains an NSMovieView object plus NSButtons for each of the play, step forward, etc. movie controller functions. A movie properties window is also included, with various NSTextView and NSTableView controls showing miscellaneous properties for the movie. In the main window, clicking on the "step forward" button, for example, will in turn call the NSMovieView stepForward method to advance the movie by a frame. Clicking the "play" button will call the NSMovieView play method to begin playing the movie. A second click on the same button will stop the movie by calling the NSMovieView stop method. Another click on the same button will toggle back to "play" mode, again calling the NSMovieView play method. The code also makes use of a QuickTime time base callback to get notified when a movie has finished playing. In this case, the "play" button state is reset so subsequent clicks will go to the beginning of the movie and begin playing it again.


How To Use The Application

Launch the application, click the "play" button (the middle button with the ">") and the included movie file will begin playing in the window. Clicking again on the same button will toggle between the "play" and "stop" functions (just like the standard QuickTime movie controller). The other buttons implement the "go to beginning", "step backward", "step forward" and "go to end" movie controller functions. Finally, selecting the "properties" menu item in the "Movie" menu will bring up a movie properties window, showing miscellaneous properties for the movie.

Project Requirements

Mac OS X
Project Builder 1.0
QuickTime 5.0